package com.ciei.dpagm.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * @author pp
 * @date 2023/03/11
 */
public enum StandardSpecificationEnum {


    // 一级
    /**
     * 选择参数
     */
    SELECT_PARAMETER(1005, "选择变量",0);


    /**
     * id
     */
    @EnumValue
    private Integer id;
    /**
     * 名称
     */
    private String name;

    /**
     * 父id
     */
    private Integer parentId;

    StandardSpecificationEnum(Integer id, String name, Integer parentId) {
        this.id = id;
        this.name = name;
        this.parentId = parentId;
    }

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public Integer getParentId() {
        return parentId;
    }

    public static StandardSpecificationEnum getEnumByValue(int value) {
        for (StandardSpecificationEnum standardSpecificationEnum : values()) {
            if (standardSpecificationEnum.getId() == value) {
                return standardSpecificationEnum;
            }
        }
        return null;
    }
}
